-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #5214 - Servlet HEAD doesn't support content-length over Integer.MAX_VALUE #5215
Conversation
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ In the case of HEAD, the servlet-api response is a wrapper of javax.servlet.http.HttpServlet$NoBodyResponse We know the content_length, use it. Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ Adding DefaultServlet.doHead() to avoid servlet wrapping + Making ResourceService HEAD aware Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
…m/eclipse/jetty.project into jetty-9.4.x-5214-head-huge-static
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but t hen I wrote half of it.... need another reviewer :)
Thank you genetlemen! I will retest after release. Any ETA on that? |
@ebremer I believe we are doing releases in the next week or two.... but if you could test this before we release, then that helps us get to a release sooner! |
@gregw I am building 9.4.x now. I will let you know how it does. |
@gregw if the build is 9.4.32-SNAPSHOT, it's still failing. |
@gregw Nevermind. The PR was not merged yet. I rebuilt using jetty-9.4.x-5214-head-huge-static and it works fine now on my installation. |
Request request = client.newRequest(destUri) | ||
.method(HttpMethod.HEAD); | ||
request.send(responseListener); | ||
Response response = responseListener.get(5, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responseListener.get()
only waits for the headers, so to be sure here I would also do (maybe in a try-with-resources):
assertEquals(-1, response.getInputStream().read());
which would guarantee that the HEAD response really came without body, as it should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
But if that fails, does that mean that both jetty server and jetty client have bugs then? ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not matter - we will have a failed test and we'll investigate :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joakime I'll fix this to get this merged ASAP.
+ check no content in HEAD response
No description provided.